<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Index</title>
    </h:head>
    <h:body>
        <h:form>
            <h1>Add a User</h1>
            <h:panelGrid id="inputPanel" columns="2">
                <h:outputLabel for="name" value="Name: "/>
                <h:inputText id="name" value="#{userUIModel.user.name}"/>
                <h:outputLabel for="email" value="Email: "/>
                <h:inputText id="email" value="#{userUIModel.user.email}"/>
            </h:panelGrid>
            <h:panelGrid id="actionPanel" columns="2">
                <h:commandButton value="Add User" action="#{userUIModel.addUser()}"/>
            </h:panelGrid>
        </h:form>
        <h:form id="listForm">
            <p:dataTable id="myUser" var="user" value="#{userUIModel.userList}"
                         rowKey="#{foren.OID}">
                <p:column headerText="ID">
                    #{user.id}
                </p:column>
                <p:column headerText="Name">
                    #{user.name}
                </p:column>
                <p:column headerText="Email">
                    #{user.email}
                </p:column>
            </p:dataTable>
        </h:form>
        <h:form id="growlForm">
            <p:growl showDetail="true" />
        </h:form>
        <br />
    </h:body>
</html>

